<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .textbox{
            width: 200px;
            height: 200px;
            background-color: pink;
            text-align: center;
            line-height: 200px;
        }
    </style>
</head>
<body>
    <div id="add">
        <ul>
            <li v-for="(i,index) in title">
                <button @click="xuanxiang(index)">{{i.item}}</button>
            </li>
        </ul>

        <div class="textbox" v-for="(i,index) in contents" v-show="contents[index].flag">
            {{i.item}}
        </div>
    </div>


    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        new Vue({
            el: "#add",

            data:{
                b:0,
                title: [{
                        item: 'html'
                    },
                    {
                        item: 'css'
                    },
                    {
                        item: 'js'
                    },
                    {
                        item: 'vuejs'
                    },
                ],
                contents: [{
                        item: 'html-contents',
                        flag:false
                    },
                    {
                        item: 'css-contents',
                        flag:false
                    },
                    {
                        item: 'js-contents',
                        flag:false
                    },
                    {
                        item: 'vuejs-contents',
                        flag:false
                    }
                ]
            },
            methods:{
                xuanxiang(a){
                    this.contents[this.b].flag = false
                    this.b = a
                    this.contents[a].flag = true
                }
            }

        })
    </script>
</body>
</html>